package edu.gyc.hiwxm.controller;

import edu.gyc.hiwxm.service.BookingService;
import edu.gyc.hiwxm.service.GirlService;
import edu.gyc.hiwxm.service.VipBookingService;
import edu.gyc.hiwxm.service.VipService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private VipService vipService;

    @Autowired
    private BookingService bookingService;

    @Autowired
    private VipBookingService vipBookingService;

    @Autowired
    private GirlService girlService;
     //后台入口
    @RequestMapping("main")
    public String index(Model model) {
        return "admin/main";
    }

    @RequestMapping("schedule")
    public String schedule() {
        return "admin/schedule";
    }

    @RequestMapping("doschedule")
    public String doschedule(String startTime, String endTime, Integer interval, Model model) {
        bookingService.schedual(startTime,endTime,interval);
        model.addAttribute("msg", "你为所有的佳丽排班成功" + startTime);
        return "admin/success";
    }
}
